package com.ruoyi.web.controller.keno.dto;

/**
 * Created by ziyeibin on 2016/9/16.
 */
public class KenoDto {
    private Long issueNo;
    private  String num;
    private  Integer total;
    private  Boolean big;
    private Boolean eight;
    private  Boolean single;
    private  String wuxing;
    private  Integer lu;


    public KenoDto(Long issueNo, Boolean big, Boolean eight,Integer lu) {
        this.issueNo = issueNo;
        this.big = big;
        this.eight = eight;
        this.lu = lu;
    }

    public KenoDto(Long issueNo, String num) {
        this.issueNo = issueNo;
        if(num.contains("|"))
            this.num = num.substring(0,num.indexOf("|"));
        else
            this.num = num;
        String[] temp1 = this.num.split(",");
        int temp = 0;
        for (String n:temp1){
            temp+=Integer.parseInt(n);
        }
        this.total = temp;
        this.single = this.total%2==0?false:true;

        if(total>810){
            this.big = true;
            this.eight = false;
        }else if(this.total<810){
            this.big = false;
            this.eight = false;
        }else{
            this.big = false;
            this.eight = true;
        }


        if(total<696){
            this.wuxing = "金";
        }else if(this.total>695 && this.total<764){
            this.wuxing = "木";
        }else if(this.total>763 && this.total<856){
            this.wuxing = "水";
        }else if(this.total>855 && this.total<924){
            this.wuxing = "火";
        }else{
            this.wuxing = "土";
        }
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Boolean getBig() {
        return big;
    }

    public void setBig(Boolean big) {
        this.big = big;
    }

    public Boolean getSingle() {
        return single;
    }

    public void setSingle(Boolean single) {
        this.single = single;
    }

    public String getWuxing() {
        return wuxing;
    }

    public void setWuxing(String wuxing) {
        this.wuxing = wuxing;
    }

    public Boolean getEight() {
        return eight;
    }

    public void setEight(Boolean eight) {
        this.eight = eight;
    }

    public Long getIssueNo() {
        return issueNo;
    }

    public void setIssueNo(Long issueNo) {
        this.issueNo = issueNo;
    }

    public Integer getLu() {
        return lu;
    }

    public void setLu(Integer lu) {
        this.lu = lu;
    }
}
